var salary = 10000
var tax=salary<5000
?0:salary<8000
?(salary-5000)*0.05:(salary-8000)*0.1+3000*0.05
console.log(tax);